<%@ page import="java.io.FileInputStream" %>
<%@ page import="java.io.File" %><%--
  Created by IntelliJ IDEA.
  User: macbookpro
  Date: 2021/3/23
  Time: 上午10:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    FileInputStream fis = new FileInputStream("/Users/macbookpro/Desktop/img/2.jpg");
    byte b[] = new byte[fis.available()];
    fis.read(b);
    fis.close();

    response.setContentType("image/jpeg");
    ServletOutputStream outputStream = response.getOutputStream();
    outputStream.write(b);

%>